home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / iritsm3s.zip / CAGD_MAT.C < prev    next >
C/C++ Source or Header  |  1991-05-19  |  947b  |  22 lines

  1. /******************************************************************************
  2. * Cagd_mat.c - General matrix routines used by all modules of CAGD_lib.          *
  3. *******************************************************************************
  4. * Written by Gershon Elber, Mar. 90.                          *
  5. ******************************************************************************/
  6.  
  7. #include "cagd_loc.h"
  8.  
  9. /******************************************************************************
  10. * Vector - Matrix multiplication. It is assumed SrcVec != DstVec and both are *
  11. * in homogeneous coordinates (i.e. vectore of length four).              *
  12. ******************************************************************************/
  13. void CagdMultMatVec(CagdMatStruct *Mat, CagdRType *SrcVec, CagdRType *DstVec)
  14. {
  15.     int i, j;
  16.  
  17.     for (i = 0; i < 4; i++) {
  18.     DstVec[i] = 0;
  19.         for (j = 0; j < 4; j++) DstVec[i] += Mat -> Mat[j][i] * SrcVec[j];
  20.     }
  21. }
  22.